﻿<%@ Page Language="C#" MasterPageFile="~/GUI/Site1.Master"  AutoEventWireup="true" CodeBehind="Register.aspx.cs" Inherits="project.GUI.WebForm1" Title="Untitled Page" %>
<asp:Content ID="contentNew" ContentPlaceHolderID="contentNew" Visible="true" runat="server">

  
    <form id="FormRegister">
    <center>
    
    <table >
    <tr>
    <td>
    Instruction
    </td>
    </tr>
     <tr>
    <td>
  1. Please don't use the same email id as password.
    </td>
    </tr>
     <tr>
    <td>
  2. Password should be 7 character long and should contain 1 letter 1 number and 1 symbol.  Allowed symbols are "@#$\()*%^&+=".
    </td>
    </tr>
    </table>
 
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:LocalSqlServer %>" 
            SelectCommand="SELECT [dept_name] FROM [Department]">
        </asp:SqlDataSource>      
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:LocalSqlServer %>" 
            SelectCommand="SELECT [role_name] FROM [Role]">
        </asp:SqlDataSource>
        <br />
        <asp:CreateUserWizard ID="cuw_Register" runat="server" RequireEmail="false"
                   OnCreatingUser="cuw_Register_Creating"
                   OnCreatedUser="cuw_Register_Created"
                   OnCreateUserError="cuw_Register_Error"
                   ValidationGroup="CreateUserWizard" 
            PasswordRegularExpression="^.*(?=.{7,100})(?=.*\\d)(?=.*[a-z])(?=.*[0-9])(?=.*[@#$\\(\\)\\*%^&+=]).*$" 
            Height="404px" Width="637px">
                    
            <WizardSteps>
                <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">
                   <ContentTemplate>
                                <table class ="uploadbox" border="-1" style="font-size: 100%; font-family: Verdana">
                                    <tr>
                                        <td align="center" colspan="2" style="font-weight: bold; color: white; background-color: #5d7b9d">
                                            Sign Up for Your New Account                  
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="center" colspan="2">
                                            <asp:Label ID="lbl_Error" runat="server" Visible="false" ForeColor="Red"></asp:Label>
                                        </td>
                                       
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            <asp:Label ID="lbl_Username" runat="server" AssociatedControlID="Username">
                                                E-mail:</asp:Label></td>
                                  <td align="left">
                                            <asp:TextBox ID="Username" runat="server" MaxLength="100"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="rfv_Email" runat="server" ControlToValidate="Username"
                                                ErrorMessage="Email is required." ToolTip="Email is required." ValidationGroup="CreateUserWizard">*</asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                           <tr>
                                        <td align="right">
                                            <asp:Label ID="lbl_Password" runat="server" AssociatedControlID="Password">Password:</asp:Label>
                                        </td>
                                        <td align="left">
                                            <asp:TextBox ID="Password" runat="server" TextMode="Password" MaxLength="100"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="rfv_Password" runat="server" ControlToValidate="Password"
                                             ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="CreateUserWizard">*</asp:RequiredFieldValidator>
                                            <%--<asp:RegularExpressionValidator ID="rev_Password" runat="server" ControlToValidate="Password"
                                             ErrorMessage="Password is not 6 characters or more." ToolTip="Password must be 6 characters or more."
                                             ValidationGroup="CreatUserWizard" ValidationExpression="([A-z]|[0-9]){6,100}"></asp:RegularExpressionValidator>
                                             --%>
                                        </td>    
                                    </tr>
                            <tr>
                                        <td align="right">
                                            <asp:Label ID="lbl_ConfirmPassword" runat="server" AssociatedControlID="txt_ConfirmPassword">Confirm Passowrd:</asp:Label>
                                        </td>
                                        <td align="left">
                                            <asp:TextBox ID="txt_ConfirmPassword" runat="server" TextMode="Password" MaxLength="100"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="rfv_ConfirmPassword" runat="server" ControlToValidate="txt_ConfirmPassword"
                                             ErrorMessage="Confirm Password is required." ToolTip="Please repeat your password." ValidationGroup="CreateUserWizer">*</asp:RequiredFieldValidator>
                                            <%--<asp:RegularExpressionValidator ID="rev_confirmPassword" runat="server" ControlToValidate="txt_ConfirmPassword"
                                             ErrorMessage="Password is not 6 characters or more." ToolTip="Password must be 6 characters or more."
                                             ValidationGroup="CreateUserWizard" ValidationExpression="([A-z]|[0-9]){6,100}"></asp:RegularExpressionValidator>
                                            --%>
                                        </td>
                            </tr>
                            <tr>
                                        <td align="right">
                                            <asp:Label ID="lbl_Request" runat="server" AssociatedControlID="txt_Request">Request:</asp:Label>
                                        </td>
                                        <td align="left">
                                            <asp:TextBox ID="txt_Request" runat="server" TextMode="MultiLine" MaxLength="3000"></asp:TextBox> 
                                            <asp:RequiredFieldValidator ID="rfv_Request" runat="server" ControlToValidate="txt_Request"
                                             ErrorMessage="Need a request." ToolTip="Place organizational request here." ValidationGroup="CreateUserWizard">*</asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            <asp:Label id="lbl_Role" runat="server" AssociatedControlID="RoleList">Role:</asp:Label>
                                        </td>
                                        <td align="left">
                                            <asp:DropDownList ID="RoleList" runat="server" DataSourceID="SqlDataSource1" 
                                                DataTextField="role_name" DataValueField="role_name" Height="26px" 
                                                Width="203px" OnDataBound="RoleList_DataBound" 
                                                onselectedindexchanged="RoleList_SelectedIndexChanged">
                                            </asp:DropDownList>
                                            <asp:RequiredFieldValidator ID="rfv_RoleList" runat="server" ControlToValidate="RoleList"
                                            ErrorMessage="Choose a Role" ValidationGroup="CreateUserWizard">*</asp:RequiredFieldValidator>               
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            <asp:Label ID="lbl_Department" runat="server" AssociatedControlID="DepartmentList">Department:</asp:Label>
                                        </td>
                                        <td align="left">
                                            <asp:DropDownList ID="DepartmentList" runat="server" 
                                                DataSourceID="SqlDataSource2" DataTextField="dept_name" 
                                                DataValueField="dept_name" Height="27px" Width="201px">
                                            </asp:DropDownList>
                                            <asp:RequiredFieldValidator ID="rfv_DepartmentList" runat="server" ControlToValidate="DepartmentList"
                                            ErrorMessage="Choose a Role" ValidationGroup="CreateUserWizard">*</asp:RequiredFieldValidator>   
                                        </td>
                                    </tr>
                            <tr>
                                <td align="right">
                                    <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">Alternate 
                                    Email:</asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="Email" runat="server"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="EmailRequired" runat="server" 
                                        ControlToValidate="Email" ErrorMessage="E-mail is required." 
                                        ToolTip="E-mail is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                    <asp:Label ID="QuestionLabel" runat="server" AssociatedControlID="Question">Security 
                                    Question:</asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="Question" runat="server"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="QuestionRequired" runat="server" 
                                        ControlToValidate="Question" ErrorMessage="Security question is required." 
                                        ToolTip="Security question is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                    <asp:Label ID="AnswerLabel" runat="server" AssociatedControlID="Answer">Security 
                                    Answer:</asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="Answer" runat="server"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="AnswerRequired" runat="server" 
                                        ControlToValidate="Answer" ErrorMessage="Security answer is required." 
                                        ToolTip="Security answer is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="center" colspan="2">
                                    <asp:CompareValidator ID="PasswordCompare" runat="server" 
                                        ControlToCompare="Password" ControlToValidate="txt_ConfirmPassword" 
                                        Display="Dynamic" 
                                        ErrorMessage="The Password and Confirmation Password must match." 
                                        ValidationGroup="CreateUserWizard1"></asp:CompareValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="center" colspan="2" style="color:Red;">
                                    <asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
                                </td>
                            </tr>
                        </table>
                    </ContentTemplate>
                </asp:CreateUserWizardStep>
                <asp:CompleteWizardStep runat="server" >
                    <ContentTemplate>
                        <asp:Label ID="lbl_Result" runat="server"></asp:Label>
                    </ContentTemplate>
                </asp:CompleteWizardStep>
            </WizardSteps>
        </asp:CreateUserWizard>

    </form>
</asp:Content>